home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Sample Code / Snippets / Sound / Record sound to disk / Record_Sound.doc < prev   
Encoding:
Text File  |  1996-11-15  |  1.1 KB  |  22 lines  |  [TEXT/CWIE]

  1. This sample shows how to use SPBRecord to record to memory and then
  2. write the recorded samples to disk, asynchronously, using PBWriteAsync.
  3.  
  4. This sample is useful for those developers who wish more flexibility
  5. than what is offered with SPBRecordToFile.
  6.  
  7. This sample uses two parameter blocks because as Macs get faster, and
  8. drives can't quite keep up, using just one parameter block for two writes
  9. is just asking for trouble.  It's not that much extra memory and it will
  10. be a weird bug you never have to find.  The pbInUse field of each parameter
  11. block is supposed to keep us from reusing the parameter block in case things
  12. get really stopped up.
  13.  
  14. These routines are designed to be easliy portable (in fact they were ripped
  15. from another sample), so you should be able to use them with little modification.
  16.  
  17. It checks for errors returned from SPBRecord and from the PBWrites.  If there
  18. is a disk error returned from a PBWrite the SPBRecord completion routine will
  19. not start the next record, killing the recording process and the error will be
  20. returned in the Vars structure (in the theErr field).
  21.  
  22. Happy recording!